/*
 * @Author: 非幡动 438484791@qq.com
 * @Date: 2024-07-04 17:23:21
 * @LastEditors: 非幡动 438484791@qq.com
 * @LastEditTime: 2024-07-25 15:59:34
 * @FilePath: \react-cornerstone-3d\src\setupProxy.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const { createProxyMiddleware } = require('http-proxy-middleware')

module.exports = function (app) {
    app.use(
        '/api', 
        createProxyMiddleware({
            // target: 'http://localhost:8001',
            // target: 'http://39.105.150.149:8042',
            // target: 'http://39.105.150.149:8001',
            // target: 'http://10.1.209.4:8001',
            // target: 'http://10.1.209.2:8001',
            target: 'http://10.1.209.1:8001',
            changeOrigin: true,
            pathRewrite:{'^/api':''}
        })
    );
    // app.use(
    //     '/server', 
    //     createProxyMiddleware({
    //         target: 'http://39.105.150.149:8042',
    //         // target: 'http://localhost:8042',
    //         // target: 'http://10.1.209.4:8042',
    //         changeOrigin: true,
    //         pathRewrite:{'^/server':''}
    //     })
    // )
}